package edu.zju.gis.dbfg.model.etl;

import edu.zju.gis.dbfg.model.scala.MIngest;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Hu
 * @date 2019/11/1
 * 基于Geotrellis实现数据ETL
 * demo类
 **/
public class ingestDemo {

  private static final Logger logger = LoggerFactory.getLogger(ingestDemo.class);

  public static void main(String[] args) {
    logger.info("Geotrellis AreaStatistic");
    // Setup environment
    logger.info("Setup Spark Context");
    SparkConf conf = new SparkConf();
    conf.setMaster("local[1]");
    conf.setAppName("lalala");
    conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer");
    JavaSparkContext jsc = new JavaSparkContext(conf);
    String input = "D:\\Work\\Study\\GeRenXueXi\\Code\\4_矢量瓦片\\data_宁波北仑_LCRA_polygon\\LCRA.tiff";
    MIngest.run(jsc.sc(), input, "D:\\Work\\Study\\GeRenXueXi\\Code\\4_矢量瓦片\\data_宁波北仑_LCRA_polygon\\out", "LCRA", 4);
  }


}
